#include<iostream>
using namespace std;
class ListNode {
public:
	int Data;
	ListNode* next;
	ListNode() {
		next = NULL;
	}
};
class List {
public:
	ListNode* head;
	int len;
	List() {
		head = NULL;
		len = 0;
	}
	void Insert(int n) {
		ListNode* q = head;
		for (int i = 1; i <= n; i++) {
			ListNode* p = new ListNode;
			p->Data = i;
			if (q == NULL) {
				head = p;
				q = head;
			}
			else {
				p->next = head;
				q->next = p;
				q = p;
			}
			len++;
		}
	}
	void pop(ListNode* p) {
		ListNode* q = head;
		if (p == q) {
			ListNode* tmp = head;
			while (tmp->next != head) {
				tmp = tmp->next;
			}
			head = head->next;
			tmp->next = head;
		}
		else {
			while (q->next != p) {
				q = q->next;
			}
			q->next = p->next;
		}
		len--;
	}
	void Pop(int N, int K, int S) {
		Insert(N);
		ListNode* p = head;
		for (int i = 1; i < S; i++) {
			p = p->next;
		}
		while (len){
			for (int i = 1; i < K; i++) {
				p = p->next;
			}
			if (len == 1) {
				cout << p->Data << endl;
				break;
			}
			else {
				cout << p->Data << ' ';
			}
			ListNode* tmp = p;
			p = p->next;
			pop(tmp);
		}
	}
	void print() {
		ListNode* p = head;
		for (int i = 0; i < len; i++) {
			cout << p->Data << ' ';
			p = p->next;
		}
	}
};
int main() {
	int N, K, S;
	while (cin >> N >> K >> S) {
		List L;
		L.Pop(N, K, S);
	}
	return 0;
}